<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>008交换两个变量的值</title>
</head>

<body>
    <h1>008交换两个变量的值</h1>
    <script>
        let a = 1
        let b = 2
        console.log(a, b)
        // 1 通过中间变量temp来实现a和b的互换
        let temp
        temp = a
        a = b
        b = temp
        console.log(a, b)
    </script>
</body>

</html>